{"version":3,"sources":["OpenContent/Templates/Gallery/js/template.js"],"names":["$","document","ready","on","event","tabCategory","target","attr","removeClass","contentCategories","index","indexOf","targetElement","element","show","split","addClass","targetLightbox","hide","targetModuleTitle","parents","find","jQuery"],"mappings":"CACM,SAAAA,gBAELA,EAAEC,UAAUC,MAAM,WAGjBF,EAAAA,kCAACG,GAAmCA,QAApC,SAAAC,GACC,IAAAC,EAAiBL,EAAII,EAAME,QAAPC,KAAA,YAKpBP,EAAAA,kCAAyBQ,YAEzBR,wBAKCA,EAAAI,EAAAE,QAAMG,SAAAA,wBAINT,EAAA,kBAAIS,KAAAA,SAAiBC,EAACC,GACrB,IAAAC,EAAeZ,EAAAI,EAAKE,QACnBN,QAAE,YACFA,KAAAA,EAACa,KAMF,EAJkBC,EAAAA,GACjBd,KAAAA,YACAe,MAAA,KAEDJ,QAAAN,GACC,QAADL,GACAA,EAAA,kBAAMc,OACNd,EAAAA,kBAAAgB,SAAiBR,2BAEhBR,EAAAA,GAAEY,OACFZ,EAAAY,GAFDI,SAAA,0BAtBF,QAAAX,GARDL,EAAAY,GAAAE,OAqCCd,EAACY,GAADI,SAAsB,2BAItBhB,EAAAY,GAAMK,YAAwB,yBAI9BjB,WAAEiB,WARHjB,EAAAY,GAAAM,QAxCWhB,UAwCXF,EAAE,kBAAkBG,GAAG,QAAS,SAACC,GAChC,IAAMe,EAAoBnB,EAAEI,EAAME,QAChCc,QAAQ,YACRb,KAAK,MACDU,EAAiBjB,EAAEI,EAAME,QAC7Bc,QAAQ,YACRC,KAAK,kBAEPrB,EAAEiB,GAAgBV,KAAK,gBAAiBY,OAlDrC,CAqDHG","file":"OpenContent\\Templates\\Gallery\\js\\template.min.js","sourcesContent":["/* global jQuery */\r\nvoid (function initGallery($) {\r\n\t'use strict';\r\n\t$(document).ready(() => {\r\n\t\tconst timeOut = 225;\r\n\r\n\t\t$('.gallery--filter .filter--item').on('click', (event) => {\r\n\t\t\tconst tabCategory = $(event.target).attr('category');\r\n\r\n\t\t\t$('.gallery--filter .filter--item').removeClass(\r\n\t\t\t\t'filter--item__active'\r\n\t\t\t);\r\n\t\t\t$(event.target).addClass('filter--item__active');\r\n\r\n\t\t\t$('.gallery--item').each((index, element) => {\r\n\t\t\t\tconst targetElement = $(event.target)\r\n\t\t\t\t\t.parents('.gallery')\r\n\t\t\t\t\t.find($(element));\r\n\r\n\t\t\t\tconst contentCategories = $(element)\r\n\t\t\t\t\t.attr('category')\r\n\t\t\t\t\t.split('_');\r\n\r\n\t\t\t\tif (contentCategories.indexOf(tabCategory) > -1) {\r\n\t\t\t\t\tif (tabCategory === 'All') {\r\n\t\t\t\t\t\t$('.gallery--item').show();\r\n\t\t\t\t\t\t$('.gallery--item').addClass('gallery--item__active');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$(targetElement).show();\r\n\t\t\t\t\t\t$(targetElement).addClass('gallery--item__active');\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (tabCategory === 'All') {\r\n\t\t\t\t\t$(targetElement).show();\r\n\t\t\t\t\t$(targetElement).addClass('gallery--item__active');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(targetElement).removeClass('gallery--item__active');\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t$(targetElement).hide();\r\n\t\t\t\t\t}, timeOut);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t$('.gallery--item').on('click', (event) => {\r\n\t\t\tconst targetModuleTitle = $(event.target)\r\n\t\t\t\t.parents('.gallery')\r\n\t\t\t\t.attr('id');\r\n\t\t\tconst targetLightbox = $(event.target)\r\n\t\t\t\t.parents('.gallery')\r\n\t\t\t\t.find('.lightbox-link');\r\n\r\n\t\t\t$(targetLightbox).attr('data-lightbox', targetModuleTitle);\r\n\t\t});\r\n\t});\r\n})(jQuery);\r\n"]}